package com.springcloud.alibaba.configclient.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:RenPu
 * @Date: 2020/7/2 18:09
 * @Version: 1.0
 * @description:
 */

@RestController
@Slf4j
@RefreshScope   //动态从nacos配置中心获取最新的文件内容
public class NacosConfigClientController {

    @Value("${config.info}")
    private String info;

    @GetMapping(value = "/nacos/config/testConfigClent")
    public String testConfigClent(){

        return "从nacos的配置中心读取到的内容为："+info;


    }


}
